﻿using System.Diagnostics;

namespace K9Nano.Updater;

public sealed class UpdaterHelper
{
    public void Start(string updaterApp, UpdaterOptions options)
    {
        options.Valiate();
        var startInfo = new ProcessStartInfo
        {
            FileName = updaterApp,
            Arguments = options.ToArguments(),
            UseShellExecute = false,
            RedirectStandardOutput = false,
            RedirectStandardError = false,
            CreateNoWindow = true
        };

        Process.Start(startInfo);
    }
}
